<!DOCTYPE html>
<html lang="zh" xmlns:th="https://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改留言')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-comment-edit" th:object="${comment}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label">昵称：</label>
            <div class="col-sm-8">
                <input name="nickname" th:field="*{nickname}" class="form-control" type="text">
            </div>
            <div class="col-sm-1">
                <img th:src="*{avatar}" style="width:24px;border-radius:100px">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">QQ号码：</label>
            <div class="col-sm-8">
                <span th:field="*{qqNum}" class="form-control" readonly/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">邮箱地址：</label>
            <div class="col-sm-8">
                <span th:field="*{email}" class="form-control" readonly/>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">留言：</label>
            <div class="col-sm-8">
                <textarea name="content" class="form-control">[[*{content}]]</textarea>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">回复的上一个留言的id：</label>
            <div class="col-sm-8">
                <input th:field="*{replyId}" class="form-control" type="text" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">收到评论是否邮件通知：</label>
            <div class="col-sm-8">
                <div class="onoffswitch">
                    <input type="checkbox" th:checked="${comment.reply}"
                           class="onoffswitch-checkbox" id="status">
                    <label class="onoffswitch-label" for="status">
                        <span class="onoffswitch-inner"></span>
                        <span class="onoffswitch-switch"></span>
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">评论的页面地址：</label>
            <div class="col-sm-8">
                <input th:field="*{url}" class="form-control" type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">点赞数：</label>
            <div class="col-sm-8">
                <input th:field="*{good}" class="form-control" type="text" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">踩数：</label>
            <div class="col-sm-8">
                <input th:field="*{bad}" class="form-control" type="text" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">其他信息</label>
            <div class="col-sm-8">
                <input th:value="${comment.ip+'/'+comment.location+'/'+comment.os+'/'+comment.browser}"
                       class="form-control" readonly>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">是否显示：</label>
            <div class="col-sm-8">
                <div class="onoffswitch">
                    <input type="checkbox" th:checked="${comment.display}" name="display"
                           class="onoffswitch-checkbox">
                    <label class="onoffswitch-label" for="status">
                        <span class="onoffswitch-inner"></span>
                        <span class="onoffswitch-switch"></span>
                    </label>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">审核信息：</label>
            <div class="col-sm-8">
                <textarea name="reviewMsg" class="form-control">[[*{reviewMsg}]]</textarea>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script type="text/javascript">
    var prefix = ctx + "blog/comment";
    $("#form-comment-edit").validate({
        focusCleanup: true
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/edit", $('#form-comment-edit').serialize());
        }
    }

    $("input[name='updateDatetime']").datetimepicker({
        format: "yyyy-mm-dd",
        minView: "month",
        autoclose: true
    });
</script>
</body>
</html>